//
//  SettingController.m
//  GoShop
//
//  Created by mac22 on 14/11/17.
//  Copyright (c) 2014年 郑朝军. All rights reserved.
//

#import "SettingController.h"
#import "GetPlistArray.h"
#import "Grouble.h"
#import "MoreTableViewCell.h"

@interface SettingController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong)NSArray * moreModelArray;
@property (nonatomic,strong)UITableView *tableView;
@end

@implementation SettingController
- (NSArray *)moreModelArray
{
    if (_moreModelArray == nil) {
        _moreModelArray = [GetPlistArray arrayWithString:@"MoreData.plist"];
    }
    return _moreModelArray;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self initTableView];
    // Do any additional setup after loading the view.
}
- (void)initTableView
{
//    self.tableView = [UITableView initWithTableView:CGRectMake(0, 0, ScreenWidth, ScreenHeight) withDelegate:self];
//    [self.view addSubview:self.tableView];
    
    
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.view addSubview:self.tableView];

    
}
#pragma mark - 返回有多少组
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 4;
}
// 返回每一行有多高
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 44;
}


// 设置一个组里面有多少行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0) {
        return 1;
    }else if (section == 1){
        return 5;
    }else if (section == 2){
        return 5;
    }else{
        return 1;
    }
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    MoreTableViewCell * cell = [MoreTableViewCell MoreTableViewCell:tableView indexPath:indexPath moreArray:self.moreModelArray];
    
    return cell;
}


-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 10;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 10;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView * backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
    backView.backgroundColor = [UIColor whiteColor];
    return backView;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UIView * backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
    backView.backgroundColor = [UIColor whiteColor];
    return backView;
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
